const baseConfig = require("./webpack.common")
const merge = require("webpack-merge")
const path = require("path")

module.exports = merge(baseConfig, {
    mode: "development",
    devtool: 'cheap-module-eval-source-map',
    module: {
        rules: [
            {
                test: /\.js$/,
                use: 'eslint-loader',
                enforce: 'pre'
            }
        ]
    },
    devServer: {
        contentBase: path.join(__dirname, "dist"),
        port: 9090,
        open: true,
        hot: true,
        proxy: {
            "/api": {
                target: "https://api.github.com",
                pathRewrite: {
                    "^/api": ""
                },
                changeOrigin: true
            }
        }
    }
})